/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-04-19 23:04:56
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-04-23 11:36:37
 * @FilePath: /free-learning/src/enums/MessageEnum.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

export enum MessageEnum {
  // 评论
  REVIEW = "review",
  // 点赞
  LIKE = "like",
  // 信息审核
  INFO_AUDIT = "info_audit",
  // 信息审核通过
  INFO_AUDIT_PASS = "info_audit_pass",
  // 信息审核未通过
  INFO_AUDIT_NOT_PASS = "info_audit_not_pass",
  // 课程审核
  COURSE_AUDIT = "course_audit",
  // 课程审核通过
  COURSE_AUDIT_PASS = "course_audit_pass",
  // 课程审核未通过
  COURSE_AUDIT_NOT_PASS = "course_audit_not_pass",
  // 评论审核
  REVIEW_AUDIT = "review_audit",
  // 评论审核通过
  REVIEW_AUDIT_PASS = "review_audit_pass",
  // 评论审核未通过
  REVIEW_AUDIT_NOT_PASS = "review_audit_not_pass",
  // 消息
  MESSAGE = "message",
}

export const useNeedSettleMessage = (type: string) => {
  return (
    type === MessageEnum.REVIEW_AUDIT_PASS ||
    type === MessageEnum.REVIEW_AUDIT_NOT_PASS ||
    type === MessageEnum.MESSAGE
  );
};

export const Message2Router: Record<string, string> = {
  [MessageEnum.REVIEW_AUDIT_PASS]: "/my-review",
  [MessageEnum.REVIEW_AUDIT_NOT_PASS]: "/my-review",
  [MessageEnum.MESSAGE]: "/chat-message",
};

export const getTypeLabel = (type: string) => {
  switch (type) {
    case MessageEnum.REVIEW_AUDIT_PASS:
      return "评论审核通过";
    case MessageEnum.REVIEW_AUDIT_NOT_PASS:
      return "评论审核未通过";
    case MessageEnum.LIKE:
      return "点赞";
    case MessageEnum.MESSAGE:
      return "消息";
  }
};
